﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Admin.ViewModels.ManufacturerViewModels>" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<%@ Import Namespace="SDT.Admin.ViewModels" %>
<%@ Import Namespace="SDT.Model"%>
<%@ Import Namespace="SDT.Lib.Paging" %>
<asp:Content ID="Content3" ContentPlaceHolderID="TitleContent" runat="server">
	Danh sách công ty - nhà máy sản xuất
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Toolbar" runat="server">	
	<%= Html.Toolbar("Thêm mới", "/Manufacturer/Create", "new")%>	
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="Header" runat="server">
	Danh sách công ty - nhà máy sản xuất
</asp:Content>

<asp:Content ID="Content6" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["Message"] != null ? "<p class='perror'>" + Html.Encode(ViewData["Message"]) + "</p>" : string.Empty%>  
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script src="/Scripts/ams.js" type="text/javascript"></script>
    <form action="/Manufacturer/Index" method="post" name="ManufacturerForm">    
    <table>
        <tr>
            <td style="border:none;" align="right"><%=Html.TextBoxFor(m=>m.Keyword) %>&nbsp;&nbsp;<input id="btnSearch" type="submit" value="Tìm kiếm" /></td> 
        </tr>
    </table>
<table style="border:none; font-weight: bold;" width="100%">
    <tbody>
        <tr>
			<td style="border:none;text-align: left">Tổng số công ty - nhà máy sản xuất: <%= Model.Manufacturers.TotalItemCount %></td>
			<td style="border:none;text-align: right;">Trang hiện tại: <%= Model.Manufacturers.PageCount > 0 ? Model.Manufacturers.PageIndex + 1 : 0%>/<%= Model.Manufacturers.PageCount%></td>
        </tr>
    </tbody>
</table>
<table style="width:100%" class="adminlist">
    <tr>
        <th style="text-align:center; width:3%">STT</th>
        <th width="30"></th>
		<th width="30"></th>
        <th style="width:30%">Tên công ty - nhà máy sản xuất</th>
        <th style="width:25%">Địa chỉ</th>
        <th style="width:15%">Số điện thoại</th>
        <th style="width:18%">Email</th>
        <th style="text-align:center;width:7%">Xóa</th>
    </tr>
    <%int index = Model.Manufacturers.PageIndex * Model.Manufacturers.PageSize + 1;
      foreach (var item in Model.Manufacturers)
      { %>
        <tr>
            <td style="text-align:center;"><%=index++ %></td>
            <td align="center">
				<%= Html.ActionImage("Sửa", "icon-24-edit.png", "Manufacturer", "Edit", new Dictionary<string, object>() { { "id", item.ID } })%>
			</td>
			 <td align="center">
				<%= Html.ActionImage("Xóa", "icon-24-delete.png", "Manufacturer", "Delete", new Dictionary<string, object>() { { "id", item.ID } })%>
			</td>
            <td>
                <%=Html.ActionLink(item.Name, "Edit", new { id = item.ID })%>
            </td>
            <td><%=Html.Encode(item.Address) %></td>
            <td><%=Html.Encode(item.Phone) %></td>
            <td><%=item.Email %></td>
            
        </tr>
     <% } %>
     
</table>
<table width="100%">
    <tr>
            <td align="center" class="pager">
                 <label>Hiển thị #</label>
                    <%
                        int[] pageSizeList = {5, 10, 15, 20, 25, 50, 100};
                    %>
                    <%= Html.DropDownList("pageSize", new SelectList(pageSizeList, Model.Manufacturers.PageSize), new { onchange = "document.providerForm.submit();" })%>
                    <%= Html.Pager(Model.Manufacturers.PageSize, Model.Manufacturers.PageNumber, Model.Manufacturers.TotalItemCount, new { pageSize = Model.Manufacturers.PageSize, key = Model.Keyword })%>
            </td>
        </tr>
</table>
</form>
</asp:Content>
